import 'package:flutter_syt/generated/json/base/json_convert_content.dart';
import 'package:flutter_syt/entity/order_ailpay_entity.dart';

OrderAilpayEntity $OrderAilpayEntityFromJson(Map<String, dynamic> json) {
  final OrderAilpayEntity orderAilpayEntity = OrderAilpayEntity();
  final String? orderNo = jsonConvert.convert<String>(json['order_no']);
  if (orderNo != null) {
    orderAilpayEntity.orderNo = orderNo;
  }
  final int? totalFee = jsonConvert.convert<int>(json['total_fee']);
  if (totalFee != null) {
    orderAilpayEntity.totalFee = totalFee;
  }
  final String? payMode = jsonConvert.convert<String>(json['pay_mode']);
  if (payMode != null) {
    orderAilpayEntity.payMode = payMode;
  }
  final OrderAilpayPayData? payData =
      jsonConvert.convert<OrderAilpayPayData>(json['pay_data']);
  if (payData != null) {
    orderAilpayEntity.payData = payData;
  }
  return orderAilpayEntity;
}

Map<String, dynamic> $OrderAilpayEntityToJson(OrderAilpayEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['order_no'] = entity.orderNo;
  data['total_fee'] = entity.totalFee;
  data['pay_mode'] = entity.payMode;
  data['pay_data'] = entity.payData?.toJson();
  return data;
}

OrderAilpayPayData $OrderAilpayPayDataFromJson(Map<String, dynamic> json) {
  final OrderAilpayPayData orderAilpayPayData = OrderAilpayPayData();
  final String? accessType = jsonConvert.convert<String>(json['access_type']);
  if (accessType != null) {
    orderAilpayPayData.accessType = accessType;
  }
  final String? cardKind = jsonConvert.convert<String>(json['card_kind']);
  if (cardKind != null) {
    orderAilpayPayData.cardKind = cardKind;
  }
  final String? merId = jsonConvert.convert<String>(json['mer_id']);
  if (merId != null) {
    orderAilpayPayData.merId = merId;
  }
  final String? returnMsg = jsonConvert.convert<String>(json['return_msg']);
  if (returnMsg != null) {
    orderAilpayPayData.returnMsg = returnMsg;
  }
  final String? attch = jsonConvert.convert<String>(json['attch']);
  if (attch != null) {
    orderAilpayPayData.attch = attch;
  }
  final String? payTime = jsonConvert.convert<String>(json['pay_time']);
  if (payTime != null) {
    orderAilpayPayData.payTime = payTime;
  }
  final String? totalAmt = jsonConvert.convert<String>(json['total_amt']);
  if (totalAmt != null) {
    orderAilpayPayData.totalAmt = totalAmt;
  }
  final String? payMode = jsonConvert.convert<String>(json['pay_mode']);
  if (payMode != null) {
    orderAilpayPayData.payMode = payMode;
  }
  final String? outTradeNo = jsonConvert.convert<String>(json['out_trade_no']);
  if (outTradeNo != null) {
    orderAilpayPayData.outTradeNo = outTradeNo;
  }
  final String? zfbDataPackage =
      jsonConvert.convert<String>(json['zfb_data_package']);
  if (zfbDataPackage != null) {
    orderAilpayPayData.zfbDataPackage = zfbDataPackage;
  }
  final String? msgId = jsonConvert.convert<String>(json['msg_id']);
  if (msgId != null) {
    orderAilpayPayData.msgId = msgId;
  }
  final String? returnCode = jsonConvert.convert<String>(json['return_code']);
  if (returnCode != null) {
    orderAilpayPayData.returnCode = returnCode;
  }
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    orderAilpayPayData.orderId = orderId;
  }
  return orderAilpayPayData;
}

Map<String, dynamic> $OrderAilpayPayDataToJson(OrderAilpayPayData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['access_type'] = entity.accessType;
  data['card_kind'] = entity.cardKind;
  data['mer_id'] = entity.merId;
  data['return_msg'] = entity.returnMsg;
  data['attch'] = entity.attch;
  data['pay_time'] = entity.payTime;
  data['total_amt'] = entity.totalAmt;
  data['pay_mode'] = entity.payMode;
  data['out_trade_no'] = entity.outTradeNo;
  data['zfb_data_package'] = entity.zfbDataPackage;
  data['msg_id'] = entity.msgId;
  data['return_code'] = entity.returnCode;
  data['order_id'] = entity.orderId;
  return data;
}
